package tedu.cn.submarine;

import javax.swing.ImageIcon;

public class NuclearSubmarine extends SeaObject implements EnemyScore{
    private int ySpeed;
    private int bossLife;
    public NuclearSubmarine(){
        super(229,50);
        ySpeed = 1;
        bossLife = 10;
    }

    public ImageIcon getImage(){
        return Images.nuclearsubm;
    }

    public int getBossLife(){
        return bossLife;
    }

    public void subtractBossLife(){
        bossLife--;
    }

    public void move(){
        setX(getX()+getSpeed());
        setY(getY()+ySpeed);
        if(getY()>=World.HEIGHT-this.getHeight() || getY()<=110){
            ySpeed *= -1;
        }
        if((getX()>=World.WIDTH-this.getWidth() || (getX()<=0 && getSpeed()<0))){
            setSpeed(getSpeed()*-1);
        }
    }

    public NuBomb shootNuBomb(){
        return new NuBomb(this.getX()+this.getWidth()/2,this.getY()-50);
    }

    public int getScore(){
        return 50;
    }
}
